
const JSEncrypt = require('./jsencrypt/jsencrypt.min.js')
const privateKey = "";
const publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnUvpZY2CawjxV80yvw7JFffUYgM4CvFURjO+7FlZ3PYF4xGn2kOtG7nqNlKHqVh41EqHYfpWKcW1D4iPsc3PwbzNh5V87xUicSwydP+8j13w75hRsDJMwVdsr7Wu2dA/2AJpKWwNMJdeyG7qLEoAZGc8kctPv3UOF4DdpWxFCoEh+I+JveGg8InJhv5Ti4OR6HrSIwI7PpGehNY0gO3EU7IqGyxg7KvXXMH3x1aIPiaB60nKbzb8PsgZHREHO7PUDwwAqvktMcXl3+J+7Gr4SMvGBoIgdx32Nr0q+naa9mDGxCJP/Oq2P+m/b2yqD2ornZcF2rlmlFZfbP64TkK/oQIDAQAB";

const Entity = new JSEncrypt()
export const decodePrivateKey = (text, key) => {
      Entity.setPrivateKey(privateKey)
      return Entity.decrypt(text);
}
export const decodePublicKey = (text, key) => {
   Entity.setPrivateKey(key)
   return Entity.decrypt(text);
}

export const encodePublicKey = (text,key) => {
   let data = {}
   Entity.setPublicKey(publicKey)
   data.body = Entity.encrypt(text);
   return data;
}

export const encodeprivateKey = (text,key) => {
   let data = {}
   Entity.setPrivateKey(privateKey)
   data.body = Entity.encrypt(text);
   return data;
}

export const encodeLongBypublicKey =(text,key)=>{
   let data = {}
   Entity.setPublicKey(key)
   data.body = Entity.encryptLong(text);
   return data;
}

export const encodeLongByPrivateKey =(text,key)=>{
   let data = {}
   Entity.setPrivateKey(privateKey)
   data.body = Entity.encryptLong(text);
   return data;
}


export const decodeLongBypublickey = (text,key) =>{
   Entity.setPublicKey(publicKey);
   return  Entity.decryptLong(text)
}

export const encodeLongByprivateKey =(text,key)=>{
   let data = {}
   Entity.setPrivateKey(privateKey)
   data.body = Entity.encryptLong(text);
   return data;
}

